package com.example.backend.service;


import com.example.backend.mapper.SuggestionMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SuggestionService {
    private SuggestionMapper suggestionMapper;

    @Autowired
    public SuggestionService(SuggestionMapper suggestionMapper)
    {
        this.suggestionMapper = suggestionMapper;
    }

    public boolean addSuggestions(@Param("suggestionId") int suggestionId, @Param("userid") int userId, @Param("content") String content, @Param("date") String date){
        int suggestion = suggestionMapper.addSuggestions(suggestionId,userId,content,date);
        if(suggestion == 0)
            return false;
        else
            return true;
    }
}
